package com.xiaoyu.izf.model;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "yqf_commission_serial_log", schema = "izf", catalog = "")
public class YqfCommissionSerialLog {
    private int id;
    private Integer amount;
    private Double rate;
    private Double commission;
    private Integer sourceUid;
    private Integer commissionUid;
    private Integer storeStatsDayId;
    private Timestamp createTime = new Timestamp(System.currentTimeMillis());

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "amount")
    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "rate")
    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    @Basic
    @Column(name = "commission")
    public Double getCommission() {
        return commission;
    }

    public void setCommission(Double commission) {
        this.commission = commission;
    }

    @Basic
    @Column(name = "source_uid")
    public Integer getSourceUid() {
        return sourceUid;
    }

    public void setSourceUid(Integer sourceUid) {
        this.sourceUid = sourceUid;
    }

    @Basic
    @Column(name = "commission_uid")
    public Integer getCommissionUid() {
        return commissionUid;
    }

    public void setCommissionUid(Integer commissionUid) {
        this.commissionUid = commissionUid;
    }

    @Basic
    @Column(name = "store_stats_day_id")
    public Integer getStoreStatsDayId() {
        return storeStatsDayId;
    }

    public void setStoreStatsDayId(Integer storeStatsDayId) {
        this.storeStatsDayId = storeStatsDayId;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        YqfCommissionSerialLog that = (YqfCommissionSerialLog) o;
        return id == that.id &&
                Objects.equals(amount, that.amount) &&
                Objects.equals(rate, that.rate) &&
                Objects.equals(commission, that.commission) &&
                Objects.equals(sourceUid, that.sourceUid) &&
                Objects.equals(commissionUid, that.commissionUid) &&
                Objects.equals(storeStatsDayId, that.storeStatsDayId) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, amount, rate, commission, sourceUid, commissionUid, storeStatsDayId, createTime);
    }
}
